;将十六进制数转到ASCii编码
data segment
    xx db 4
    ascii db ?
data ends

code segment
    assume cs:code,ds:data
start:
    mov ax,data
    mov ds,ax

    mov al,xx
    and al,0fh

    cmp al,9
    ja lab1
    add al,30h
    jmp lab2
lab1:
    add al,37h
lab2:
    mov ascii,al
    
    mov ah,4ch
    int 21h
code ends

end start